function columns($proc,$db,$table){
    $q=$db->prepare('show columns in '.mysql_real_escape_string($table));
    $q->execute();
    while($row=$q->fetch())$proc($row[0]);
}


function tableswithcolumns($proc,$db,$columns){
    $columns="'".implode("','",$columns)."'";
        echo $columns;
    $q=$db->prepare("select distinct table_name from information_schema.columns where column_name in ($columns) and table_schema='sitegeist'");
    $q->execute();
    while($row=$q->fetch())$proc($row[0]);
}
